import * as AI_RATES from 'quadratic-shared/ai/models/AI_RATES';
import type { AIModelConfig, AIModelKey } from 'quadratic-shared/typesAndSchemasAI';

// updating this will force the model to be reset to the default model in local storage
export const DEFAULT_MODEL_VERSION = 33;

// used when `quadratic:quadratic-auto:thinking-toggle-off` is selected, in model router
export const DEFAULT_MODEL_ROUTER_MODEL: AIModelKey = 'vertexai:gemini-2.5-flash-lite:thinking-toggle-off';

// used when `restrictedCountry` is true, in model router
export const RESTRICTED_MODEL_ROUTER_MODEL: AIModelKey = 'azure-openai:gpt-4.1-mini';

// AI Analyst and AI Assistant chat models
export const DEFAULT_MODEL: AIModelKey = 'vertexai-anthropic:claude-haiku-4-5@20251001:thinking-toggle-on';
export const DEFAULT_MODEL_WITH_IMAGE: AIModelKey = 'azure-openai:gpt-4.1';

// Backup models for AI Analyst and AI Assistant chat models
export const DEFAULT_BACKUP_MODEL: AIModelKey = 'azure-openai:gpt-4.1';

// Start with AI models
export const DEFAULT_MODEL_START_WITH_AI_SUGGESTIONS: AIModelKey = 'vertexai:gemini-2.5-flash-lite:thinking-toggle-off';
export const DEFAULT_MODEL_START_WITH_AI_PLAN: AIModelKey = 'vertexai:gemini-2.5-flash:thinking-toggle-on';
export const DEFAULT_BACKUP_MODEL_THINKING: AIModelKey = 'vertexai-anthropic:claude-sonnet-4-5@20250929';

// Internal tool call models
export const DEFAULT_GET_CHAT_NAME_MODEL: AIModelKey = 'vertexai:gemini-2.5-flash-lite:thinking-toggle-off';
export const DEFAULT_PDF_IMPORT_MODEL: AIModelKey = 'vertexai:gemini-2.5-flash:thinking-toggle-on';
export const DEFAULT_SEARCH_MODEL: AIModelKey = 'vertexai:gemini-2.5-flash:thinking-toggle-on';
export const DEFAULT_CODE_EDITOR_COMPLETIONS_MODEL: AIModelKey = 'vertexai:gemini-2.5-flash-lite:thinking-toggle-on';
export const DEFAULT_GET_USER_PROMPT_SUGGESTIONS_MODEL: AIModelKey =
  'vertexai:gemini-2.5-flash-lite:thinking-toggle-on';
export const DEFAULT_GET_EMPTY_CHAT_PROMPT_SUGGESTIONS_MODEL: AIModelKey =
  'vertexai:gemini-2.5-flash-lite:thinking-toggle-off';
export const DEFAULT_OPTIMIZE_PROMPT_MODEL: AIModelKey = 'vertexai:gemini-2.5-flash:thinking-toggle-on';

export const MODELS_CONFIGURATION: {
  [key in AIModelKey]: AIModelConfig;
} = {
  // uses 'DEFAULT_MODEL_ROUTER_MODEL' to find the best model for this prompt,
  // settings and price correspond to the current 'DEFAULT_MODEL_ROUTER_MODEL'
  'quadratic:quadratic-auto:thinking-toggle-off': {
    ...AI_RATES.gemini_2_5_flash_lite_rate,
    model: 'quadratic-auto',
    displayName: 'auto',
    displayProvider: 'Quadratic',
    temperature: 0.1,
    max_tokens: 8192,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'quadratic',
    promptCaching: false,
    thinking: false,
    thinkingToggle: false,
    imageSupport: true,
  },
  'quadratic:quadratic-auto:thinking-toggle-on': {
    ...AI_RATES.claude_sonnet_4_5_20250926_rate,
    model: 'us.anthropic.claude-sonnet-4-5-20250929-v1:0',
    backupModelKey: 'anthropic:claude-sonnet-4.5:thinking-toggle-on',
    displayName: 'Sonnet 4.5',
    displayProvider: 'Claude',
    temperature: 1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'bedrock-anthropic',
    promptCaching: true,
    thinking: true,
    thinkingToggle: true,
    imageSupport: true,
  },
  'vertexai-anthropic:claude-sonnet-4-5@20250929:thinking-toggle-off': {
    ...AI_RATES.claude_sonnet_4_5_20250926_rate,
    model: 'claude-sonnet-4-5@20250929',
    backupModelKey: 'anthropic:claude-sonnet-4.5:thinking-toggle-off',
    displayName: 'Sonnet 4.5',
    displayProvider: 'Claude',
    temperature: 0.1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'vertexai-anthropic',
    promptCaching: true,
    thinking: false,
    thinkingToggle: false,
    imageSupport: true,
  },
  'vertexai-anthropic:claude-sonnet-4-5@20250929:thinking-toggle-on': {
    ...AI_RATES.claude_sonnet_4_5_20250926_rate,
    model: 'claude-sonnet-4-5@20250929',
    backupModelKey: 'anthropic:claude-sonnet-4.5:thinking-toggle-on',
    displayName: 'Sonnet 4.5',
    displayProvider: 'Claude',
    temperature: 1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'max',
    provider: 'vertexai-anthropic',
    promptCaching: true,
    thinking: true,
    thinkingToggle: true,
    imageSupport: true,
  },
  'vertexai-anthropic:claude-sonnet-4-5@20250929': {
    ...AI_RATES.claude_sonnet_4_5_20250926_rate,
    model: 'claude-sonnet-4-5@20250929',
    backupModelKey: 'anthropic:claude-sonnet-4.5:thinking-toggle-on',
    displayName: 'Sonnet 4.5',
    displayProvider: 'Claude',
    temperature: 1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'others',
    provider: 'vertexai-anthropic',
    promptCaching: true,
    thinking: true,
    imageSupport: true,
  },
  'vertexai-anthropic:claude-haiku-4-5@20251001:thinking-toggle-off': {
    model: 'claude-haiku-4-5@20251001',
    backupModelKey: 'bedrock-anthropic:anthropic.claude-haiku-4-5-20251001-v1:0:thinking-toggle-off',
    displayName: 'Haiku 4.5',
    displayProvider: 'Claude',
    temperature: 0.1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'vertexai-anthropic',
    promptCaching: true,
    thinking: false,
    thinkingToggle: false,
    imageSupport: true,
    ...AI_RATES.claude_haiku_4_5_20251001_rate,
  },
  'vertexai-anthropic:claude-haiku-4-5@20251001:thinking-toggle-on': {
    model: 'claude-haiku-4-5@20251001',
    backupModelKey: 'anthropic:claude-haiku-4.5:thinking-toggle-on',
    displayName: 'Haiku 4.5',
    displayProvider: 'Claude',
    temperature: 1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'fast',
    provider: 'vertexai-anthropic',
    promptCaching: true,
    thinking: true,
    thinkingToggle: true,
    imageSupport: true,
    ...AI_RATES.claude_haiku_4_5_20251001_rate,
  },
  'vertexai-anthropic:claude-haiku-4-5@20251001': {
    model: 'claude-haiku-4-5@20251001',
    backupModelKey: 'anthropic:claude-haiku-4.5:thinking-toggle-on',
    displayName: 'Haiku 4.5',
    displayProvider: 'Claude',
    temperature: 1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'others',
    provider: 'vertexai-anthropic',
    promptCaching: true,
    thinking: true,
    imageSupport: true,
    ...AI_RATES.claude_haiku_4_5_20251001_rate,
  },
  'vertexai:gemini-2.5-flash:thinking-toggle-off': {
    ...AI_RATES.gemini_2_5_flash_rate,
    model: 'gemini-2.5-flash',
    displayName: '2.5 flash',
    displayProvider: 'Gemini',
    temperature: 0.1,
    max_tokens: 65535,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'vertexai',
    promptCaching: false,
    thinking: false,
    thinkingToggle: false,
    thinkingBudget: 0,
    imageSupport: true,
  },
  'vertexai:gemini-2.5-flash:thinking-toggle-on': {
    ...AI_RATES.gemini_2_5_flash_rate,
    model: 'gemini-2.5-flash',
    displayName: '2.5 flash',
    displayProvider: 'Gemini',
    temperature: 0.1,
    max_tokens: 65535,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'vertexai',
    promptCaching: false,
    thinking: true,
    thinkingToggle: true,
    thinkingBudget: 24576,
    imageSupport: true,
  },
  'vertexai:gemini-2.5-flash-lite:thinking-toggle-off': {
    ...AI_RATES.gemini_2_5_flash_lite_rate,
    model: 'gemini-2.5-flash-lite',
    displayName: '2.5 flash lite',
    displayProvider: 'Gemini',
    temperature: 0.1,
    max_tokens: 65535,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'vertexai',
    promptCaching: false,
    thinking: false,
    thinkingBudget: 512,
    imageSupport: true,
  },
  'vertexai:gemini-2.5-flash-lite:thinking-toggle-on': {
    ...AI_RATES.gemini_2_5_flash_lite_rate,
    model: 'gemini-2.5-flash-lite',
    displayName: '2.5 Flash-Lite',
    displayProvider: 'Gemini',
    temperature: 0.1,
    max_tokens: 65535,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'vertexai',
    promptCaching: false,
    thinking: true,
    thinkingToggle: true,
    thinkingBudget: 24576,
    imageSupport: true,
  },
  'vertexai:gemini-2.5-pro': {
    ...AI_RATES.gemini_2_5_pro_rate,
    model: 'gemini-2.5-pro',
    displayName: '2.5 Pro',
    displayProvider: 'Gemini',
    temperature: 0.1,
    max_tokens: 65535,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'vertexai',
    promptCaching: false,
    thinking: false,
    imageSupport: true,
  },
  'vertexai:gemini-3-pro-preview': {
    ...AI_RATES.gemini_2_5_pro_rate,
    model: 'gemini-3-pro-preview',
    displayName: '3.0 Pro',
    displayProvider: 'Gemini',
    temperature: 0.1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'others',
    provider: 'vertexai',
    promptCaching: false,
    thinking: false,
    imageSupport: true,
  },
  'geminiai:gemini-2.5-flash-lite-preview-06-17': {
    ...AI_RATES.gemini_2_5_flash_lite_rate,
    model: 'gemini-2.5-flash-lite-preview-06-17',
    displayName: '2.5 Flash-Lite',
    displayProvider: 'Gemini',
    temperature: 0.1,
    max_tokens: 65535,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'geminiai',
    promptCaching: false,
    thinking: false,
    thinkingBudget: 0,
    imageSupport: true,
  },
  'bedrock-anthropic:us.anthropic.claude-sonnet-4-5-20250929-v1:0:thinking-toggle-off': {
    ...AI_RATES.claude_sonnet_4_5_20250926_rate,
    model: 'us.anthropic.claude-sonnet-4-5-20250929-v1:0',
    backupModelKey: 'azure-openai:gpt-5-codex',
    displayName: 'Sonnet 4.5',
    displayProvider: 'Claude',
    temperature: 0.1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'bedrock-anthropic',
    promptCaching: true,
    thinking: false,
    thinkingToggle: false,
    imageSupport: true,
  },
  'bedrock-anthropic:us.anthropic.claude-sonnet-4-5-20250929-v1:0:thinking-toggle-on': {
    ...AI_RATES.claude_sonnet_4_5_20250926_rate,
    model: 'us.anthropic.claude-sonnet-4-5-20250929-v1:0',
    backupModelKey: 'azure-openai:gpt-5-codex',
    displayName: 'Sonnet 4.5',
    displayProvider: 'Claude',
    temperature: 1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'bedrock-anthropic',
    promptCaching: true,
    thinking: true,
    thinkingToggle: true,
    imageSupport: true,
  },
  'bedrock-anthropic:anthropic.claude-haiku-4-5-20251001-v1:0:thinking-toggle-off': {
    ...AI_RATES.claude_haiku_4_5_20251001_rate,
    model: 'anthropic.claude-haiku-4-5-20251001-v1:0',
    backupModelKey: 'anthropic:claude-haiku-4.5:thinking-toggle-off',
    displayName: 'Haiku 4.5',
    displayProvider: 'Claude',
    temperature: 0.1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'bedrock-anthropic',
    promptCaching: true,
    thinking: false,
    thinkingToggle: false,
    imageSupport: true,
  },
  'bedrock-anthropic:anthropic.claude-haiku-4-5-20251001-v1:0:thinking-toggle-on': {
    ...AI_RATES.claude_haiku_4_5_20251001_rate,
    model: 'anthropic.claude-haiku-4-5-20251001-v1:0',
    backupModelKey: 'anthropic:claude-haiku-4.5:thinking-toggle-on',
    displayName: 'Haiku 4.5',
    displayProvider: 'Claude',
    temperature: 1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'bedrock-anthropic',
    promptCaching: true,
    thinking: true,
    thinkingToggle: true,
    imageSupport: true,
  },
  'bedrock:us.deepseek.r1-v1:0': {
    model: 'us.deepseek.r1-v1:0',
    displayName: 'R1',
    displayProvider: 'DeepSeek',
    temperature: 0.1,
    max_tokens: 32768,
    canStream: true,
    canStreamWithToolCalls: false,
    mode: 'disabled',
    provider: 'bedrock',
    promptCaching: false,
    thinking: false,
    imageSupport: true,
    rate_per_million_input_tokens: 1.35,
    rate_per_million_output_tokens: 5.4,
    rate_per_million_cache_read_tokens: 0,
    rate_per_million_cache_write_tokens: 0,
  },
  'anthropic:claude-sonnet-4.5:thinking-toggle-off': {
    ...AI_RATES.claude_sonnet_4_5_20250926_rate,
    model: 'claude-sonnet-4-5-20250929',
    backupModelKey: 'bedrock-anthropic:us.anthropic.claude-sonnet-4-5-20250929-v1:0:thinking-toggle-off',
    displayName: 'Sonnet 4.5',
    displayProvider: 'Claude',
    temperature: 0.1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'anthropic',
    promptCaching: true,
    thinking: false,
    thinkingToggle: false,
    imageSupport: true,
  },
  'anthropic:claude-sonnet-4.5:thinking-toggle-on': {
    ...AI_RATES.claude_sonnet_4_5_20250926_rate,
    model: 'claude-sonnet-4-5-20250929',
    backupModelKey: 'bedrock-anthropic:us.anthropic.claude-sonnet-4-5-20250929-v1:0:thinking-toggle-on',
    displayName: 'Sonnet 4.5',
    displayProvider: 'Claude',
    temperature: 1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'anthropic',
    promptCaching: true,
    thinking: true,
    thinkingToggle: true,
    imageSupport: true,
  },
  'anthropic:claude-haiku-4.5:thinking-toggle-off': {
    ...AI_RATES.claude_haiku_4_5_20251001_rate,
    model: 'claude-haiku-4-5-20251001',
    displayName: 'Haiku 4.5',
    displayProvider: 'Claude',
    temperature: 0.1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'anthropic',
    promptCaching: true,
    thinking: false,
    thinkingToggle: false,
    imageSupport: true,
  },
  'anthropic:claude-haiku-4.5:thinking-toggle-on': {
    ...AI_RATES.claude_haiku_4_5_20251001_rate,
    model: 'claude-haiku-4-5-20251001',
    displayName: 'Haiku 4.5',
    displayProvider: 'Claude',
    temperature: 1,
    max_tokens: 64000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'anthropic',
    promptCaching: true,
    thinking: true,
    thinkingToggle: true,
    imageSupport: true,
  },
  'openai:gpt-5-codex': {
    model: 'gpt-5-codex',
    backupModelKey: 'baseten:moonshotai/Kimi-K2-Instruct-0905',
    displayName: 'GPT-5-Codex',
    displayProvider: 'OpenAI',
    temperature: 1,
    max_tokens: 128000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'openai',
    promptCaching: true, // not used for openai, managed by the api
    strictParams: true,
    imageSupport: true,
    supportsReasoning: true,
    serviceTier: 'default',
    rate_per_million_input_tokens: 1.25,
    rate_per_million_output_tokens: 10,
    rate_per_million_cache_read_tokens: 0.125,
    rate_per_million_cache_write_tokens: 0,
  },
  'openai:gpt-5-2025-08-07': {
    model: 'gpt-5-2025-08-07',
    backupModelKey: 'baseten:moonshotai/Kimi-K2-Instruct-0905',
    displayName: 'GPT-5',
    displayProvider: 'OpenAI',
    temperature: 1,
    max_tokens: 128000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'openai',
    promptCaching: true, // not used for openai, managed by the api
    strictParams: true,
    imageSupport: true,
    supportsReasoning: true,
    serviceTier: 'priority',
    rate_per_million_input_tokens: 2.5,
    rate_per_million_output_tokens: 20,
    rate_per_million_cache_read_tokens: 0.25,
    rate_per_million_cache_write_tokens: 0,
  },
  'openai:gpt-4.1-2025-04-14': {
    model: 'gpt-4.1-2025-04-14',
    backupModelKey: 'openai:gpt-4.1-2025-04-14',
    displayName: 'GPT-4.1',
    displayProvider: 'OpenAI',
    temperature: 0.1,
    max_tokens: 32768,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'openai',
    promptCaching: true, // not used for openai, managed by the api
    strictParams: true,
    imageSupport: true,
    rate_per_million_input_tokens: 2,
    rate_per_million_output_tokens: 8,
    rate_per_million_cache_read_tokens: 0.5,
    rate_per_million_cache_write_tokens: 0,
  },
  'openai:o4-mini-2025-04-16': {
    model: 'o4-mini-2025-04-16',
    displayName: 'o4 Mini',
    displayProvider: 'OpenAI',
    temperature: 1, // only temperature 1 is supported for o1
    max_tokens: 100000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'openai',
    promptCaching: true, // not used for openai, managed by the api
    strictParams: true,
    imageSupport: true,
    supportsReasoning: true,
    rate_per_million_input_tokens: 1.1,
    rate_per_million_output_tokens: 4.4,
    rate_per_million_cache_read_tokens: 0.275,
    rate_per_million_cache_write_tokens: 0,
  },
  'openai:o3-2025-04-16': {
    model: 'o3-2025-04-16',
    displayName: 'o3',
    displayProvider: 'OpenAI',
    temperature: 1, // only temperature 1 is supported for o1
    max_tokens: 100000,
    canStream: false, // stream is not supported for o1
    canStreamWithToolCalls: false,
    mode: 'disabled',
    provider: 'openai',
    promptCaching: true, // not used for openai, managed by the api
    strictParams: true,
    imageSupport: true,
    supportsReasoning: true,
    rate_per_million_input_tokens: 10,
    rate_per_million_output_tokens: 40,
    rate_per_million_cache_read_tokens: 2.5,
    rate_per_million_cache_write_tokens: 0,
  },
  'azure-openai:gpt-5.1-codex': {
    model: 'gpt-5.1-codex',
    backupModelKey: 'openai:gpt-5-codex',
    displayName: 'GPT-5.1-Codex',
    displayProvider: 'OpenAI',
    temperature: 1,
    max_tokens: 128000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'others',
    provider: 'azure-openai',
    promptCaching: true, // not used for openai, managed by the api
    strictParams: true,
    imageSupport: true,
    supportsReasoning: true,
    rate_per_million_input_tokens: 1.25,
    rate_per_million_output_tokens: 10,
    rate_per_million_cache_read_tokens: 0.125,
    rate_per_million_cache_write_tokens: 0,
  },
  'azure-openai:gpt-5.1': {
    model: 'gpt-5.1',
    backupModelKey: 'openai:gpt-5-2025-08-07',
    displayName: 'GPT-5.1',
    displayProvider: 'OpenAI',
    temperature: 1,
    max_tokens: 128000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'others',
    provider: 'azure-openai',
    promptCaching: true, // not used for openai, managed by the api
    strictParams: true,
    imageSupport: true,
    supportsReasoning: true,
    rate_per_million_input_tokens: 2.5,
    rate_per_million_output_tokens: 20,
    rate_per_million_cache_read_tokens: 0.25,
    rate_per_million_cache_write_tokens: 0,
  },
  'azure-openai:gpt-5-codex': {
    model: 'gpt-5-codex',
    backupModelKey: 'openai:gpt-5-codex',
    displayName: 'GPT-5-Codex',
    displayProvider: 'OpenAI',
    temperature: 1,
    max_tokens: 128000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'azure-openai',
    promptCaching: true, // not used for openai, managed by the api
    strictParams: true,
    imageSupport: true,
    supportsReasoning: true,
    rate_per_million_input_tokens: 1.25,
    rate_per_million_output_tokens: 10,
    rate_per_million_cache_read_tokens: 0.125,
    rate_per_million_cache_write_tokens: 0,
  },
  'azure-openai:gpt-5': {
    model: 'gpt-5',
    backupModelKey: 'openai:gpt-5-2025-08-07',
    displayName: 'GPT-5',
    displayProvider: 'OpenAI',
    temperature: 1,
    max_tokens: 128000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'azure-openai',
    promptCaching: true, // not used for openai, managed by the api
    strictParams: true,
    imageSupport: true,
    supportsReasoning: true,
    rate_per_million_input_tokens: 2.5,
    rate_per_million_output_tokens: 20,
    rate_per_million_cache_read_tokens: 0.25,
    rate_per_million_cache_write_tokens: 0,
  },
  'azure-openai:gpt-4.1': {
    model: 'gpt-4.1',
    backupModelKey: 'openai:gpt-4.1-2025-04-14',
    displayName: 'GPT-4.1',
    displayProvider: 'OpenAI',
    temperature: 0.1,
    max_tokens: 32768,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'azure-openai',
    promptCaching: true,
    strictParams: true,
    imageSupport: true,
    rate_per_million_input_tokens: 2,
    rate_per_million_output_tokens: 8,
    rate_per_million_cache_read_tokens: 0.5,
    rate_per_million_cache_write_tokens: 0,
  },
  'azure-openai:gpt-4.1-mini': {
    model: 'gpt-4.1-mini',
    backupModelKey: 'azure-openai:gpt-4.1',
    displayName: 'GPT-4.1 mini',
    displayProvider: 'OpenAI',
    temperature: 0.1,
    max_tokens: 32768,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'azure-openai',
    promptCaching: true,
    strictParams: true,
    imageSupport: true,
    rate_per_million_input_tokens: 0.44,
    rate_per_million_output_tokens: 1.76,
    rate_per_million_cache_read_tokens: 0.11,
    rate_per_million_cache_write_tokens: 0,
  },
  'azure-openai:o3': {
    model: 'o3',
    displayName: 'o3',
    displayProvider: 'OpenAI',
    temperature: 1,
    max_tokens: 32768,
    canStream: false,
    canStreamWithToolCalls: false,
    mode: 'disabled',
    provider: 'azure-openai',
    promptCaching: true,
    strictParams: true,
    imageSupport: true,
    supportsReasoning: true,
    rate_per_million_input_tokens: 2,
    rate_per_million_output_tokens: 8,
    rate_per_million_cache_read_tokens: 0.5,
    rate_per_million_cache_write_tokens: 0,
  },
  'xai:grok-4-0709': {
    model: 'grok-4-0709',
    displayName: 'Grok 4',
    displayProvider: 'xAI',
    temperature: 0.1,
    max_tokens: 256000,
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'xai',
    promptCaching: true, // not used for xai
    strictParams: true,
    imageSupport: true,
    rate_per_million_input_tokens: 3,
    rate_per_million_output_tokens: 15,
    rate_per_million_cache_read_tokens: 0,
    rate_per_million_cache_write_tokens: 0,
  },
  'baseten:moonshotai/Kimi-K2-Instruct-0905': {
    model: 'moonshotai/Kimi-K2-Instruct-0905',
    backupModelKey: 'baseten:deepseek-ai/DeepSeek-V3.1',
    displayName: 'Kimi K2 Instruct 0905',
    displayProvider: 'Moonshot AI',
    temperature: 0.6,
    max_tokens: 0, // use api default
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'baseten',
    promptCaching: true,
    strictParams: true,
    imageSupport: false,
    rate_per_million_input_tokens: 0.6,
    rate_per_million_output_tokens: 2.5,
    rate_per_million_cache_read_tokens: 0,
    rate_per_million_cache_write_tokens: 0,
    // Sampling parameters
    top_p: 0.8,
    top_k: 20,
    min_p: 0,
    repetition_penalty: 1.05,
  },
  'baseten:Qwen/Qwen3-Coder-480B-A35B-Instruct': {
    model: 'Qwen/Qwen3-Coder-480B-A35B-Instruct',
    backupModelKey: 'fireworks:accounts/fireworks/models/qwen3-coder-480b-a35b-instruct',
    displayName: 'Qwen3-Coder-480B',
    displayProvider: 'Qwen',
    temperature: 0.7,
    max_tokens: 0, // use api default
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'baseten',
    promptCaching: true,
    strictParams: true,
    imageSupport: false,
    rate_per_million_input_tokens: 0.38,
    rate_per_million_output_tokens: 1.53,
    rate_per_million_cache_read_tokens: 0,
    rate_per_million_cache_write_tokens: 0,
    // Sampling parameters
    top_p: 0.8,
    top_k: 20,
    min_p: 0,
    repetition_penalty: 1.05,
  },
  'baseten:deepseek-ai/DeepSeek-V3.1': {
    model: 'deepseek-ai/DeepSeek-V3.1',
    backupModelKey: 'azure-openai:gpt-4.1',
    displayName: 'V3.1',
    displayProvider: 'DeepSeek',
    temperature: 0.6,
    max_tokens: 0, // use api default
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'baseten',
    promptCaching: true,
    strictParams: true,
    imageSupport: false,
    rate_per_million_input_tokens: 0.5,
    rate_per_million_output_tokens: 1.5,
    rate_per_million_cache_read_tokens: 0,
    rate_per_million_cache_write_tokens: 0,
    // Sampling parameters
    top_p: 0.95,
    top_k: 20,
    min_p: 0,
    repetition_penalty: 1.05,
  },
  'fireworks:accounts/fireworks/models/qwen3-coder-480b-a35b-instruct': {
    model: 'accounts/fireworks/models/qwen3-coder-480b-a35b-instruct',
    backupModelKey: 'fireworks:accounts/fireworks/models/qwen3-coder-480b-a35b-instruct',
    displayName: 'Qwen3-Coder-480B',
    displayProvider: 'Qwen',
    temperature: 0.7,
    max_tokens: 0, // use api default
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'fireworks',
    promptCaching: true,
    strictParams: false, // Fireworks doesn't support strict parameter
    imageSupport: false,
    rate_per_million_input_tokens: 0.45,
    rate_per_million_output_tokens: 1.8,
    rate_per_million_cache_read_tokens: 0,
    rate_per_million_cache_write_tokens: 0,
    // Sampling parameters
    top_p: 0.8,
    top_k: 20,
    min_p: 0,
    repetition_penalty: 1.05,
  },
  'fireworks:accounts/fireworks/models/deepseek-v3p1': {
    model: 'accounts/fireworks/models/deepseek-v3p1',
    backupModelKey: 'azure-openai:gpt-4.1',
    displayName: 'V3.1',
    displayProvider: 'DeepSeek',
    temperature: 0.2,
    max_tokens: 0, // use api default
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'fireworks',
    promptCaching: true,
    strictParams: false, // Fireworks doesn't support strict parameter
    imageSupport: false,
    rate_per_million_input_tokens: 0.56,
    rate_per_million_output_tokens: 1.68,
    rate_per_million_cache_read_tokens: 0,
    rate_per_million_cache_write_tokens: 0,
    // Sampling parameters
    top_p: 0.8,
    top_k: 20,
    min_p: 0,
    repetition_penalty: 1.05,
  },
  'open-router:deepseek/deepseek-r1-0528': {
    model: 'deepseek/deepseek-r1-0528',
    displayName: 'R1-0528',
    displayProvider: 'DeepSeek',
    temperature: 0.1,
    max_tokens: 0, // use api default
    canStream: true,
    canStreamWithToolCalls: true,
    mode: 'disabled',
    provider: 'open-router',
    promptCaching: true,
    strictParams: true,
    imageSupport: false,
    rate_per_million_input_tokens: 0.5,
    rate_per_million_output_tokens: 2.15,
    rate_per_million_cache_read_tokens: 0,
    rate_per_million_cache_write_tokens: 0,
  },
} as const;
